package com.edu.commons;

import lombok.Getter;

/**
 * @ProjectName: summer-project
 * @Titile: ServiceException
 * @Author: Lucky
 * @Description: 统一的业务异常类
 */
public class ServiceException extends RuntimeException {
    //业务码类型
    @Getter  //生成getter，供外部使用
    private ServiceCode serviceCode;
    /**
     * 构造方法
     * @param serviceCode 业务码对象
     * @param message 异常消息
     */
    public ServiceException(ServiceCode serviceCode,String message) {
        super(message);//把异常消息传递到父类进行构造
        this.serviceCode = serviceCode;
    }
}
